<template>
  <div>
    <el-button @click="logout" type="danger">退出</el-button>
  </div>
</template>

<script>
export default {
  methods: {
    logout() {
      if (!confirm("确认退出吗?")) return;
      // 删除token
      window.sessionStorage.removeItem("token");
      this.$router.replace("/login");
    },
  },
};
</script>

<style>
</style>